# This file is Copyright 2007, 2009 Dean Hall.
#
# This file is part of the Python-on-a-Chip program.
# Python-on-a-Chip is free software: you can redistribute it and/or modify
# it under the terms of the GNU LESSER GENERAL PUBLIC LICENSE Version 2.1.
# 
# Python-on-a-Chip is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# A copy of the GNU LESSER GENERAL PUBLIC LICENSE Version 2.1
# is seen in the file COPYING up one directory from this.

#
# Runs the interactive interpreter
#

from sys import getb, time, wait
#from speaker import play_sound, nosound

from events import init
init()

from keyboard import init
init()

def raw_input(prompt=''):
    print prompt,

    result = ''

    while True:
        c = chr(getb())
        if c == '\n':
            break
        print c,
        result += c

    return result


print "Hello from Python world!!! :-)"

result = 3+2
print "3 + 2 =",result
#print "3 + 2 =",str(result)


#play_sound(1000)
#wait(10000)
#nosound()

while True:
#    s = raw_input('> ')
#    print
#    print s
    print "Time:", time()
    wait(1000)

#import ipm
#ipm.ipm()
